DECLARE @MODIFIED_USER_ID uniqueidentifier

SET @MODIFIED_USER_ID = '00000000-0000-0000-0000-000000000001'


IF NOT EXISTS (SELECT * FROM GRIDVIEWS WHERE NAME = 'Employees.EmployeeList')
BEGIN
	INSERT INTO GRIDVIEWS(NAME,MODULE_NAME,VIEW_NAME,CREATED_BY,MODIFIED_USER_ID)
	VALUES('Employees.EmployeeList','Employees','vwEMPLOYEES_List',@MODIFIED_USER_ID,@MODIFIED_USER_ID)
	
	INSERT INTO GRIDVIEWS_COLUMNS(DELETED,CREATED_BY,MODIFIED_USER_ID,GRID_NAME,COLUMN_INDEX,
								COLUMN_TYPE,DEFAULT_VIEW,HEADER_TEXT,SORT_EXPRESSION,ITEMSTYLE_WIDTH,ITEMSTYLE_CSSCLASS,
								ITEMSTYLE_HORIZONTAL_ALIGN,ITEMSTYLE_VERTICAL_ALIGN,ITEMSTYLE_WRAP,DATA_FIELD,DATA_FORMAT,
								URL_FIELD,URL_FORMAT,URL_TARGET,LIST_NAME,URL_MODULE,URL_ASSIGNED_FIELD)
	VALUES(0,@MODIFIED_USER_ID,@MODIFIED_USER_ID,'Employees.EmployeeList',0,'HyperLinkColumn',0,'Employees.LBL_NAME','FULL_NAME',NULL,NULL,NULL,NULL,0,'FULL_NAME',
	'HyperLink','ID','~/Employees/view.aspx?id={0}',NULL,NULL,NULL,NULL)
	
	INSERT INTO GRIDVIEWS_COLUMNS(DELETED,CREATED_BY,MODIFIED_USER_ID,GRID_NAME,COLUMN_INDEX,
								COLUMN_TYPE,DEFAULT_VIEW,HEADER_TEXT,SORT_EXPRESSION,ITEMSTYLE_WIDTH,ITEMSTYLE_CSSCLASS,
								ITEMSTYLE_HORIZONTAL_ALIGN,ITEMSTYLE_VERTICAL_ALIGN,ITEMSTYLE_WRAP,DATA_FIELD,DATA_FORMAT,
								URL_FIELD,URL_FORMAT,URL_TARGET,LIST_NAME,URL_MODULE,URL_ASSIGNED_FIELD)
	VALUES(0,@MODIFIED_USER_ID,@MODIFIED_USER_ID,'Employees.EmployeeList',1,'BoundColumn',0,'Employees.LBL_TITLE','TITLE',NULL,NULL,NULL,NULL,0,'TITLE',
	NULL,NULL,NULL,NULL,NULL,NULL,NULL)
	
	INSERT INTO GRIDVIEWS_COLUMNS(DELETED,CREATED_BY,MODIFIED_USER_ID,GRID_NAME,COLUMN_INDEX,
								COLUMN_TYPE,DEFAULT_VIEW,HEADER_TEXT,SORT_EXPRESSION,ITEMSTYLE_WIDTH,ITEMSTYLE_CSSCLASS,
								ITEMSTYLE_HORIZONTAL_ALIGN,ITEMSTYLE_VERTICAL_ALIGN,ITEMSTYLE_WRAP,DATA_FIELD,DATA_FORMAT,
								URL_FIELD,URL_FORMAT,URL_TARGET,LIST_NAME,URL_MODULE,URL_ASSIGNED_FIELD)
	VALUES(0,@MODIFIED_USER_ID,@MODIFIED_USER_ID,'Employees.EmployeeList',2,'BoundColumn',0,'Employees.PHONE_OTHER','PHONE_OTHER',NULL,NULL,NULL,NULL,0,'PHONE_OTHER',
	NULL,NULL,NULL,NULL,NULL,NULL,NULL)
	
	INSERT INTO GRIDVIEWS_COLUMNS(DELETED,CREATED_BY,MODIFIED_USER_ID,GRID_NAME,COLUMN_INDEX,
								COLUMN_TYPE,DEFAULT_VIEW,HEADER_TEXT,SORT_EXPRESSION,ITEMSTYLE_WIDTH,ITEMSTYLE_CSSCLASS,
								ITEMSTYLE_HORIZONTAL_ALIGN,ITEMSTYLE_VERTICAL_ALIGN,ITEMSTYLE_WRAP,DATA_FIELD,DATA_FORMAT,
								URL_FIELD,URL_FORMAT,URL_TARGET,LIST_NAME,URL_MODULE,URL_ASSIGNED_FIELD)
	VALUES(0,@MODIFIED_USER_ID,@MODIFIED_USER_ID,'Employees.EmployeeList',3,'HyperLinkColumn',0,'Employees.LBL_EMAIL','EMAIL',NULL,NULL,NULL,NULL,0,'EMAIL1',
	NULL,'EMAIL1','mailto:{0}',NULL,NULL,NULL,NULL)
	
	INSERT INTO GRIDVIEWS_COLUMNS(DELETED,CREATED_BY,MODIFIED_USER_ID,GRID_NAME,COLUMN_INDEX,
								COLUMN_TYPE,DEFAULT_VIEW,HEADER_TEXT,SORT_EXPRESSION,ITEMSTYLE_WIDTH,ITEMSTYLE_CSSCLASS,
								ITEMSTYLE_HORIZONTAL_ALIGN,ITEMSTYLE_VERTICAL_ALIGN,ITEMSTYLE_WRAP,DATA_FIELD,DATA_FORMAT,
								URL_FIELD,URL_FORMAT,URL_TARGET,LIST_NAME,URL_MODULE,URL_ASSIGNED_FIELD)
	VALUES(0,@MODIFIED_USER_ID,@MODIFIED_USER_ID,'Employees.EmployeeList',4,'BoundColumn',0,'Employees.LBL_MOBILE_PHONE','PHONE_MOBILE',NULL,NULL,NULL,NULL,0,'PHONE_MOBILE',
	NULL,NULL,NULL,NULL,NULL,NULL,NULL)
END